#!/bin/bash

#  target==
#     size = w * h = 300 * 400
#     format=jpg

input="xx.jpg"
output="xxx.jpg"
ffmpeg -nostdin -y -i "${input}" -vf "scale=300:400:force_original_aspect_ratio=decrease,pad=300:400:(ow-iw)/2:(oh-ih)/2" "${output}"

